<template lang="pug">
.cp-course-online-view
  el-dialog(:title="title", :visible="visible", @close="close", width="80%")
    el-container.ol-container
      el-header.ol-header(height="36px")
        span
          i 【 课程名称 】
          i.key-point(v-text="detail.name")
        span.desc-after
          i 【 课程代号 】
          i.key-point(v-text="detail.code")
      el-container.ol-body
        el-aside.body-aside(width="20%")
          ul
            li(v-for="(item, index) in detail.patchList")
              span(v-text="item.name")
        el-main.body-main
          video(width="100%", height="100%", controls)
            source(:src="videoSrc", type="video/mp4")
      el-footer.ol-footer(height="auto")
        el-button(type="primary", plain) 已学习
        el-button(type="primary", plain) 开始测试
</template>

<script>
import { mapGetters } from 'vuex';

export default {
  name: 'courseonlineview',
  props: {
    title: {
      type: String,
      default: '课程学习'
    },
    visible: Boolean,
    detail: Object
  },
  data() {
    return {
      videoSrc: 'https://www.w3cschool.cn/statics/demosource/movie.mp4'
    };
  },
  methods: {
    close () {
      this.$emit('close');
    }
  },
  computed: {
    ...mapGetters([])
  },
  mounted () {}
};
</script>

<style lang="sass">
$BORDERCOLOR: #ccc
$RADIUS: 8px
.cp-course-online-view
  .ol-header
    text-align: center
    .desc-after
      margin-left: 36px
    .key-point
      font-weight: 800
      color: black
  .ol-body
    .body-main
      overflow: hidden
      max-height: 412px
      padding: 0
      text-align: center
      border: 1px solid black
      border-top-right-radius: $RADIUS
      border-bottom-right-radius: $RADIUS
      background-color: black
    .body-aside
      padding: 16px
      border-top: 1px solid $BORDERCOLOR
      border-left: 1px solid $BORDERCOLOR
      border-bottom: 1px solid $BORDERCOLOR
      border-top-left-radius: $RADIUS
      border-bottom-left-radius: $RADIUS
      li
        height: 32px
        line-height: 32px
  .ol-footer
    margin-top: 20px
    text-align: right
</style>
